<?php
namespace App\Controllers\Goods;
use \App\Libs\Base\Constant;
use App\Models\Peizhi\Peizhi;

/**
*	搜索热门搜索
*/
class GetHotSearch extends \App\Libs\Base\BaseAction
{
	 protected function beforeRun() {
         parent::beforeRun();
         //$this->needLogin = TRUE;
     }
	public function execute() {
		//查询是否存在KEY
		$hotSearch = Peizhi::find(array(
			'type = :type:',
			'bind' => array('type'=>5),
		));
		if( !empty( $hotSearch ) ){
			return \App\Libs\Views\Json::view(0, '成功', json_decode( $hotSearch->data ) );
		}else{
			return \App\Libs\Views\Json::view(0, '成功', []);
		}
		
	}
}
